FROM vcpkgdockercontainers.azurecr.io/vcpkg/alpine:3.11

RUN apk add alpine-sdk cmake ninja git curl tar gzip zip

COPY . /source

ARG FMT_TARBALL_URL

ARG CMAKERC_TARBALL_URL

ARG VCPKG_BASE_VERSION

ARG VCPKG_STANDALONE_BUNDLE_SHA

RUN cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DCMAKE_CXX_FLAGS="-static -s -static-libgcc -static-libstdc++" "-DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION" "-DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA" "-DVCPKG_FMT_URL=$FMT_TARBALL_URL" "-DVCPKG_CMAKERC_URL=$CMAKERC_TARBALL_URL" -S /source -B /build  2>&1

RUN ninja -C build
